A gateway device, such as a set-top box (STB) gateway, includes buffer space (e.g., a memory) that is allocated to store transmitted data packets (e.g., video, audio, or multimedia packets) for retransmission purposes. The buffer space may be deallocated when an acknowledgement packet is received in response to the transmitted data packet. The buffers that store the transmitted packets may be scattered throughout the memory. As a result, there may be processing complexity associated with allocating/deallocating and managing the buffers.
In the gateway device, received packets may be inserted into a ring buffer in the order the packets are received. However, the packets may be received out of sequence. Thus, it may be difficult to determine how much of the ring buffer has been consumed and can be reclaimed. In some approaches, a sweep and mark procedure is performed where each item in the ring buffer is examined and marked if the item has been consumed. The marked items are then cleared. Since each item in the ring buffer is examined (e.g., a read operation from memory), the sweep and mark procedure may require a large number of memory accesses.